home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / listings / v_02_11 / 2n11056a < prev    next >
Text File  |  1991-09-27  |  429b  |  14 lines

  1.  
  2. Listing 1.  SCASB Method of Finding Terminator Zero
  3.  
  4.   string    DB    "This is a string",0
  5.   .....
  6.   cld                     ; clear direction
  7.   mov   cx,0ffffh         ; set counter
  8.   mov   di,offset string  ; load offset
  9.   mov   al,0              ; load comparison value
  10.   repnz scasb             ; find the zero
  11.   not   cx                ; take ones complement
  12.   dec   cx                ; adjust length
  13.   .....
  14.